package com.rany.day02;

import java.util.Scanner;

public class DemoStringCount {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一串字符：");
        String input = scanner.next();

        int countUpper = 0;
        int countLower = 0;
        int countNumber = 0;
        int countOther = 0;

        char[] chars = input.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            char ch = chars[i]; //当前单个字符
            if('A' < ch  && ch <'Z'){
                countUpper++;
            }else if ('a' < ch && ch < 'z'){
                countLower++;
            }else if ('0'<ch && ch < '9'){
                countNumber++;
            }else {
                countOther++;
            }
        }
        System.out.println(countNumber);
        System.out.println(countLower);
        System.out.println(countUpper);
        System.out.println(countOther);
    }
}
